<html>
<head>
    <meta charset="utf-8">
    <title>商品管理</title>
    <#assign base=request.contextPath  />
    <#setting  number_format="0.##"/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${base}/frame/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="${base}/sweep/css/app.css" media="all">
    <link rel="stylesheet" href="${base}/sweep/css/mui.min.css" media="all">
    <link rel="stylesheet" type="text/css" href="${base}/sweep/css/style.css" />
    <script src="${base}/backstage/js/jquery-1.8.3.min.js"></script>
    <script src="${base}/sweep/js/mui.min.js"></script>
    <script src="${base}/backstage/layui/layui.js"></script>
</head>
<body>
<div class="mui-content">
    <ul class="mui-table-view" style="margin-bottom: 90px;">
        <#list good as good>
            <li class="mui-table-view-cell mui-media" onclick="window.location.href='${base}/wx/good/goodDetails.html?id=${good.id}'">
                <a href="javascript:;">
                    <img class="mui-media-object mui-pull-left" src="${good.goodUrl}">
                    <div class="mui-media-body">
                        ${good.goodName}
                        <p class='mui-ellipsis' style="position: relative;top:6px;"><span style="color: red;font-size: 17px;">￥ ${good.goodPrice}</span><span>/赚 ￥ ${good.saleProfit}</span></p>
                        <#if good.businesses==1>
                            <button type="button" onclick="xia('${good.id}')" class="layui-btn  layui-btn-radius" style="float: right;height: 32px;width: 96px;">下 架</button>
                        </#if>
                        <#if good.businesses==2>
                            <button type="button" onclick="xia('${good.id}')" class="layui-btn layui-btn-danger layui-btn-radius" style="float: right;height: 32px;width: 96px;">上 架</button>
                        </#if>

                    </div>
                </a>
            </li>
        </#list>
    </ul>
</div>
<div class="mui-content" style="position: fixed;bottom: 0;width: 100%;background: none" >
    <div class="mui-content-padded">
        <button type="button" class="mui-btn mui-btn-warning " style="width: 100%;height: 50px;font-size: 22px" id="fan">返 回</button>
    </div>
</div>
</body>
<script>
    layui.use(['form', 'layer', 'upload'], function () {
        var form = layui.form
            , layer = layui.layer
            , $ = layui.jquery
            , upload = layui.upload;


    })
    $("#fan").one("click",function(){
        window.location.href="${base}/wx/user/personal.html";
    })
    function xia(id) {
        $.ajax({
            type: "POST",
            url: "${base}/wx/good/updateBusinesses",
            data: {id:id} ,
            success: function (data) {
                if(data.code==200){
                    layer.msg(data.msg)
                    window.location.href = "${base}/wx/user/good.html";
                }else{
                    layer.msg(data.msg)
                }
            },
        });
    }
</script>
</html>


